package com.block.datapush.service.apipush;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.block.common.model.param.PushApiKeyParam;
import com.block.common.service.LogFactory;
import com.block.datapush.enums.PushStatusEnum;
import com.block.datapush.model.PushQueryParam;
import com.block.datapush.model.dto.NoticeParamDTO;
import com.block.datapush.model.result.ProtocolParamResult;
import com.block.datapush.model.result.PushApiResult;
import com.block.datapush.service.IPushApiService;
import com.block.datapush.service.apipush.utils.SuZhou;
import com.block.db.entity.MemberSourceInfo;
import com.block.db.entity.MerchantBaseInfo;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 苏州鑫满融信息咨询有限公司
 */
@Service
public class XinManRongApiService implements IPushApiService {

    private static final Logger log = LogFactory.getPushLog();



    @Override
    public PushApiResult checkUser(String orderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) {

        PushApiResult pushApiResult = new PushApiResult();
        pushApiResult.setPushSuccess(false);

        String queryUrl = pushApiKeyParam.getQueryUrl();

        Map<String, Object> paramMap0 = new HashMap<>();
        paramMap0.put("device", "open_api");
        paramMap0.put("login", pushApiKeyParam.getApiKey());
        paramMap0.put("password", pushApiKeyParam.getApiSecret());
        paramMap0.put("corp_id", pushApiKeyParam.getApiCode());


        log.info("【苏州鑫满融】登录【queryUrl】{}【bizParam】{}", queryUrl, JSON.toJSONString(paramMap0));
        String response0 = HttpUtil.createPost(queryUrl)
                .form(paramMap0)
                .execute().body();
        log.info("【苏州鑫满融】登录【response0】{}", response0);
        JSONObject returnjson = JSON.parseObject(response0);
        Integer code = returnjson.getInteger("code");

        if (!StrUtil.equals(String.valueOf(code), "0")) {
            pushApiResult.setMessage("登录认证失败");
            return pushApiResult;
        }

        JSONObject data = returnjson.getJSONObject("data");

        String userToken = data.getString("user_token");
        String userID = data.getString("user_id");

        extJson.put("userToken", userToken);
        extJson.put("userID", userID);

        String matchUrl = pushApiKeyParam.getCheckUrl();

        Map<String, String> headMap = new HashMap<>();
        headMap.put("Authorization", "Token token=" + userToken + ",device=open_api,version_code=9.9.9");

        Map<String, Object> bizmap = new HashMap<>();
        bizmap.put("query", memberSourceInfo.getMobileMd5());
        bizmap.put("entity_type", "customer");

        log.info("【苏州鑫满融】撞库开始【queryUrl】{}【paramMap】{}", matchUrl, JSON.toJSONString(bizmap));
        String result = HttpUtil.createGet(matchUrl)
                .headerMap(headMap, true)
                .form(bizmap)
                .execute().body();
        log.info("【苏州鑫满融】撞库结束【result】{}", result);


        JSONObject resultObject = JSON.parseObject(result);
        Integer code1 = resultObject.getInteger("code");
        Integer totalCount = resultObject.getJSONObject("data").getInteger("total_count");

        pushApiResult.setCode(String.valueOf(code1));
        pushApiResult.setParamInfo(JSON.toJSONString(bizmap));
        pushApiResult.setResultInfo(result);

        if (StrUtil.equals(String.valueOf(code1), "0") && StrUtil.equals(String.valueOf(totalCount), "0")) {
            pushApiResult.setPushSuccess(true);
        } else {
            String message = resultObject.getString("message");
            pushApiResult.setMessage(message);
        }
        return pushApiResult;
    }

    @Override
    public PushApiResult queryApprove(String orderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) {
        return null;
    }

    @Override
    public PushApiResult registerUser(String orderNo, String outOrderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) {
        PushApiResult pushApiResult = new PushApiResult();
        pushApiResult.setPushSuccess(false);
        pushApiResult.setOrderNo(orderNo);

        String userToken = extJson.getString("userToken");
        String userId = extJson.getString("userId");

        Map<String, String> headMap = new HashMap<>();
        headMap.put("Authorization", "Token token=" + userToken + ",device=open_api,version_code=9.9.9");
        headMap.put("Content-Type", "application/json;charset=utf-8");

        Map<String, Object> addressAttributes = new HashMap<>();
        addressAttributes.put("detail_address", "");
        addressAttributes.put("tel", memberSourceInfo.getMobile());
        addressAttributes.put("url", "");
        addressAttributes.put("country_id", "");
        addressAttributes.put("province_id", "");
        addressAttributes.put("city_id", "");
        addressAttributes.put("district_id", "");
        addressAttributes.put("zip", "");
        addressAttributes.put("fax", "");
        addressAttributes.put("qq", "");
        addressAttributes.put("wechat", "");
        addressAttributes.put("wangwang", "");
        addressAttributes.put("phone", memberSourceInfo.getMobile());
        addressAttributes.put("email", "");

        Map<String, Object> costomerMap = new HashMap<>();
        costomerMap.put("approve_status", "");
        costomerMap.put("user_id", userId);
        costomerMap.put("parent_id", "");
        costomerMap.put("name", memberSourceInfo.getRealname());
        costomerMap.put("note", this.getUserInfo(memberSourceInfo));
        costomerMap.put("status", "enable");
        costomerMap.put("category", "3392232");
        costomerMap.put("source", "3392233");
        costomerMap.put("industry", "3392234");
        costomerMap.put("staff_size", "");
        costomerMap.put("want_department_id", "");
        costomerMap.put("address_attributes", addressAttributes);
        costomerMap.put("labels", "");
        costomerMap.put("custom_field_template_id", "");

        Map<String, Object> paramMap = new HashMap<>();
        paramMap.put("customer", costomerMap);

        String registerUrl = pushApiKeyParam.getRegisterUrl();
        log.info("【苏州鑫满融】进件开始【queryUrl】{}【paramMap】{}", registerUrl, JSON.toJSONString(paramMap));
        String result = HttpUtil.createPost(registerUrl)
                .headerMap(headMap, true)
                .body(JSON.toJSONString(paramMap))
                .execute().body();
        log.info("【苏州鑫满融】进件结束【result】{}", result);

        JSONObject resultObject = JSON.parseObject(result);
        Integer code = resultObject.getInteger("code");
        String data = resultObject.getString("data");
        String message = resultObject.getString("message");

        pushApiResult.setCode(String.valueOf(code));
        pushApiResult.setParamInfo(JSON.toJSONString(paramMap));
        pushApiResult.setResultInfo(result);

        if (StrUtil.equals(String.valueOf(code), "0")) {
            pushApiResult.setMessage(data);
            pushApiResult.setPushSuccess(true);
            pushApiResult.setSettleFlag(true);
            pushApiResult.setStatus(PushStatusEnum.SUCCESS.getValue());
            return pushApiResult;
        }
        pushApiResult.setMessage(message);
        pushApiResult.setPushSuccess(false);
        pushApiResult.setSettleFlag(false);
        pushApiResult.setStatus(PushStatusEnum.FAILED.getValue());
        return pushApiResult;
    }

    @Override
    public PushApiResult queryResult(PushQueryParam pushQueryParam, PushApiKeyParam pushApiKeyParam, String extJson) {
        PushApiResult pushApiResult = new PushApiResult();
        pushApiResult.setPushSuccess(false);
        return pushApiResult;
    }


    @Override
    public NoticeParamDTO getNoticeResultParam(String infoId, Map<String, String[]> parameterMap, String paramContent) {
        NoticeParamDTO noticeParamDTO = new NoticeParamDTO();
        return noticeParamDTO;
    }

    @Override
    public JSONObject getNoticeResultReturn(Map<String, String[]> parameterMap, String paramContent, JSONObject extObject) {
        JSONObject jsonObject = new JSONObject();
        return jsonObject;
    }

    @Override
    public ProtocolParamResult getProtocolResult(MerchantBaseInfo merchantBaseInfo, MemberSourceInfo memberSourceInfo) {
        ProtocolParamResult paramResult = new ProtocolParamResult();
        return paramResult;
    }


    private String getUserInfo(MemberSourceInfo memberSourceInfo) {
        String sex = ObjectUtil.equals(memberSourceInfo.getSex(), 1) ? "男" : "女";
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder
                .append("城市：" + memberSourceInfo.getCity()).append("；")
                .append("年龄：" + memberSourceInfo.getAge()).append("；")
                .append("性别：" + sex).append("；")
                .append(SuZhou.getHouse(memberSourceInfo.getHouse())).append("；")
                .append(SuZhou.getCar(memberSourceInfo.getCar())).append("；")
                .append(SuZhou.getGjj(memberSourceInfo.getGjj())).append("；")
                .append(SuZhou.getYuqi(memberSourceInfo.getYuqi())).append("；")
                .append(SuZhou.getShebao(memberSourceInfo.getShebao())).append("；")
                .append(SuZhou.getBaodan(memberSourceInfo.getBaoxian())).append("；")
                .append(SuZhou.getZhima(memberSourceInfo.getZhima())).append("；")
                .append(SuZhou.getJd(memberSourceInfo.getBaitiao())).append("；")
                .append(SuZhou.getHuabei(memberSourceInfo.getHuabei())).append("；");
        return stringBuilder.toString();
    }

//        public static void main(String[] args) {
//
//        String queryUrl = "https://lxcrm.weiwenjia.com/api/v2/auth/login";
//
//        Map<String, Object> paramMap0 = new HashMap<>();
//        paramMap0.put("device", "open_api");
//        paramMap0.put("login", "18151107759");
//        paramMap0.put("password", "Li198688");
//        paramMap0.put("corp_id", "wwjdVTxPjwY2mb2jWAiE");
//        String response0 = HttpUtil.createPost(queryUrl)
//                .form(paramMap0)
//                .execute().body();
//        JSONObject returnjson = JSON.parseObject(response0);
//
//        JSONObject data = returnjson.getJSONObject("data");
//        String userToken = data.getString("user_token");
//        String url = "https://lxcrm.weiwenjia.com/api/v2/field_maps/customer";
//        Map<String, Object> paramMap1 = new HashMap<>();
//        paramMap1.put("user_token",userToken);
//        String response = HttpUtil.createGet(url)
//                .form(paramMap1)
//                .execute().body();
//        System.err.println(response);
//    }

//    {"code":0,"data":{"customer":[{"id":3392231,"field_name":"status","field_name_mapped":"跟进状态","klass_name":"Customer","field_type":"select","column_type":"string","field_values":[{"id":21358664,"field_map_id":3392231,"name":"","value":"初访","status":"enable","position":0,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-09-06T16:25:31.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":1},{"id":21358665,"field_map_id":3392231,"name":"","value":"意向","status":"enable","position":1,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-09-06T16:25:31.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":2},{"id":24145719,"field_map_id":3392231,"name":"","value":"已到访","status":"disable","position":2,"created_at":"2021-09-06T16:25:27.000+08:00","updated_at":"2023-09-08T08:58:21.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":21358666,"field_map_id":3392231,"name":"","value":"报价","status":"disable","position":3,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-09-08T08:58:22.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":3},{"id":21358668,"field_map_id":3392231,"name":"","value":"暂时搁置","status":"enable","position":4,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-27T16:49:20.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":5},{"id":21617773,"field_map_id":3392231,"name":"","value":"潜在客户","status":"enable","position":5,"created_at":"2021-05-27T18:42:26.000+08:00","updated_at":"2023-06-27T16:49:20.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":33742242,"field_map_id":3392231,"name":"","value":"空号","status":"disable","position":6,"created_at":"2022-07-29T09:56:21.000+08:00","updated_at":"2023-09-08T08:58:12.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":33742243,"field_map_id":3392231,"name":"","value":"外地号","status":"disable","position":7,"created_at":"2022-07-29T09:56:28.000+08:00","updated_at":"2023-09-08T08:58:17.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":21358667,"field_map_id":3392231,"name":"","value":"成交","status":"enable","position":8,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-27T16:49:20.000+08:00","setting_html_options":{"readonly":true},"organization_id":11569633,"meta_field_value_id":4},{"id":60494261,"field_map_id":3392231,"name":"","value":"7天待上门客户","status":"enable","position":9,"created_at":"2023-09-08T12:46:09.000+08:00","updated_at":"2023-09-08T12:46:09.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":60494272,"field_map_id":3392231,"name":"","value":"30天内要用钱客户","status":"enable","position":10,"created_at":"2023-09-08T12:56:11.000+08:00","updated_at":"2023-09-08T12:56:11.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":60496620,"field_map_id":3392231,"name":"","value":"已上门","status":"enable","position":11,"created_at":"2023-09-08T16:23:30.000+08:00","updated_at":"2023-09-08T16:23:30.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null}]},{"id":3392232,"field_name":"category","field_name_mapped":"客户类型","klass_name":"Customer","field_type":"select","column_type":"string","field_values":[{"id":21358669,"field_map_id":3392232,"name":"","value":"A(重要客户)邀约成功7天内待上门","status":"disable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-09-08T13:11:03.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":6},{"id":21358670,"field_map_id":3392232,"name":"","value":"B(普通客户)待邀约30天内要用钱","status":"disable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-09-08T13:11:04.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":7},{"id":21358671,"field_map_id":3392232,"name":"","value":"C(低价值客户)","status":"disable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:47:03.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":8},{"id":60494285,"field_map_id":3392232,"name":"","value":"预估可做","status":"enable","position":3,"created_at":"2023-09-08T13:11:52.000+08:00","updated_at":"2023-09-08T14:55:35.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null}]},{"id":3392233,"field_name":"source","field_name_mapped":"客户来源","klass_name":"Customer","field_type":"select","column_type":"string","field_values":[{"id":23256366,"field_map_id":3392233,"name":"","value":"短信回复","status":"enable","position":0,"created_at":"2021-08-02T15:59:17.000+08:00","updated_at":"2023-06-21T11:08:02.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":null},{"id":58942667,"field_map_id":3392233,"name":"","value":"询盘","status":"enable","position":0,"created_at":"2023-08-07T05:52:00.000+08:00","updated_at":"2023-08-07T05:52:00.000+08:00","setting_html_options":{"readonly":true},"organization_id":11569633,"meta_field_value_id":null},{"id":21358672,"field_map_id":3392233,"name":"","value":"广告","status":"disable","position":1,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:09:39.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":9},{"id":21358673,"field_map_id":3392233,"name":"","value":"社交推广","status":"disable","position":2,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:09:40.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":10},{"id":21358674,"field_map_id":3392233,"name":"","value":"研讨会","status":"disable","position":3,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:09:41.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":11},{"id":21358675,"field_map_id":3392233,"name":"","value":"搜索引擎","status":"disable","position":4,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:09:42.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":12},{"id":21358676,"field_map_id":3392233,"name":"","value":"客户介绍","status":"enable","position":5,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:10:19.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":13},{"id":21358677,"field_map_id":3392233,"name":"","value":"独立开发","status":"enable","position":6,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-08-02T15:59:20.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":14},{"id":21358678,"field_map_id":3392233,"name":"","value":"代理商","status":"disable","position":7,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:10:20.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":15},{"id":21358679,"field_map_id":3392233,"name":"","value":"其他","status":"disable","position":8,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:10:20.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":16},{"id":21358788,"field_map_id":3392233,"name":"","value":"搜客宝","status":"disable","position":9,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2023-06-21T11:09:17.000+08:00","setting_html_options":{"readonly":true,"check_enable":true},"organization_id":11569633,"meta_field_value_id":520},{"id":21358789,"field_map_id":3392233,"name":"","value":"机器人","status":"enable","position":10,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-08-02T15:59:20.000+08:00","setting_html_options":{"readonly":true,"check_enable":true},"organization_id":11569633,"meta_field_value_id":521}]},{"id":3392234,"field_name":"industry","field_name_mapped":"所属行业","klass_name":"Customer","field_type":"select","column_type":"string","field_values":[{"id":21358680,"field_map_id":3392234,"name":"","value":"服务","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":17},{"id":21358681,"field_map_id":3392234,"name":"","value":"金融","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":18},{"id":21358682,"field_map_id":3392234,"name":"","value":"电信","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":19},{"id":21358683,"field_map_id":3392234,"name":"","value":"教育","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":20},{"id":21358684,"field_map_id":3392234,"name":"","value":"高科技","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":21},{"id":21358685,"field_map_id":3392234,"name":"","value":"政府","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":22},{"id":21358686,"field_map_id":3392234,"name":"","value":"制造","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":23},{"id":21358687,"field_map_id":3392234,"name":"","value":"能源","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":24},{"id":21358688,"field_map_id":3392234,"name":"","value":"零售","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":25},{"id":21358689,"field_map_id":3392234,"name":"","value":"媒体","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":26},{"id":21358690,"field_map_id":3392234,"name":"","value":"娱乐","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":27},{"id":21358691,"field_map_id":3392234,"name":"","value":"咨询","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":28},{"id":21358692,"field_map_id":3392234,"name":"","value":"非盈利事业","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":29},{"id":21358693,"field_map_id":3392234,"name":"","value":"公用事业","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":30}]},{"id":3392235,"field_name":"staff_size","field_name_mapped":"人员规模","klass_name":"Customer","field_type":"select","column_type":"string","field_values":[{"id":21358694,"field_map_id":3392235,"name":"","value":"<10人","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":31},{"id":21358695,"field_map_id":3392235,"name":"","value":"10-20人","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":32},{"id":21358696,"field_map_id":3392235,"name":"","value":"20-50人","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":33},{"id":21358697,"field_map_id":3392235,"name":"","value":"50-100人","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":34},{"id":21358698,"field_map_id":3392235,"name":"","value":"100-500人","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":35},{"id":21358699,"field_map_id":3392235,"name":"","value":"500人以上","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":36}]},{"id":3392236,"field_name":"channel","field_name_mapped":"渠道","klass_name":"Customer","field_type":"select","column_type":"string","field_values":[{"id":21358700,"field_map_id":3392236,"name":"","value":"无","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{"readonly":true},"organization_id":11569633,"meta_field_value_id":37},{"id":21358701,"field_map_id":3392236,"name":"","value":"微信","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":38},{"id":21358702,"field_map_id":3392236,"name":"","value":"QQ","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":39},{"id":21358703,"field_map_id":3392236,"name":"","value":"微博","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-05-18T10:02:00.000+08:00","setting_html_options":{},"organization_id":11569633,"meta_field_value_id":40},{"id":21358704,"field_map_id":3392236,"name":"","value":"百度","status":"enable","position":null,"created_at":"2021-05-18T10:02:00.000+08:00","updated_at":"2021-09-23T21:02:59.000+08:00","setting_html_options":{"readonly":true},"organization_id":11569633,"meta_field_value_id":41},{"id":24823401,"field_map_id":3392236,"name":"","value":"头条","status":"enable","position":0,"created_at":"2021-09-23T21:02:59.000+08:00","updated_at":"2021-09-23T21:02:59.000+08:00","setting_html_options":{"readonly":true},"organization_id":11569633,"meta_field_value_id":null},{"id":24823402,"field_map_id":3392236,"name":"","value":"腾讯","status":"enable","position":0,"created_at":"2021-09-23T21:02:59.000+08:00","updated_at":"2021-09-23T21:02:59.000+08:00","setting_html_options":{"readonly":true},"organization_id":11569633,"meta_field_value_id":null}]}]}}

}
